<?php
$Discussion->WhisperUsername = ForceIncomingString('SendTo', $Discussion->WhisperUsername);

echo '
<div id="Form" class="StartDiscussion">
	<fieldset>
		<legend>'.$this->Title.'</legend>
		'.$this->Get_Warnings().'
		'.$this->Get_PostBackForm('frmPostDiscussion', 'post', 'extension.php').'
		<ul>
			<li>
				<label for="WhisperUsername">'.$this->Context->GetDefinition('MessageTo').'</label>
				<input id="WhisperUsername" name="WhisperUsername" type="text" value="'.FormatStringForDisplay($Discussion->WhisperUsername, 0).'" class="Whisper AutoCompleteInput" maxlength="20" />
				<script type="text/javascript">
					var WhisperAutoComplete = new AutoComplete("WhisperUsername", false);
					WhisperAutoComplete.TableID = "WhisperAutoCompleteResults";
					WhisperAutoComplete.KeywordSourceUrl = "'.$this->Context->Configuration['WEB_ROOT'].'ajax/getusers.php?Search=";
				</script>
			</li>
			<li>
				<label for="txtTopic">'.$this->Context->GetDefinition('MessageSubject').'</label>
				<input id="txtTopic" type="text" name="Name" class="DiscussionBox" maxlength="100" value="'.$Discussion->Name.'" />
			</li>
			<li>
				<label for="CommentBox">
				<a href="./" id="CommentBoxController" onclick="'
				."ToggleCommentBox('".$this->Context->Configuration['WEB_ROOT']."ajax/switch.php', '".$this->Context->GetDefinition('SmallInput')."', '".$this->Context->GetDefinition('BigInput')."'); return false;".'">'.$this->Context->GetDefinition($this->Context->Session->User->Preference('ShowLargeCommentBox')?'SmallInput':'BigInput').'</a>'.$this->Context->GetDefinition('MessageBody').'
				</label>
				<textarea name="Body" class="'
				.($this->Context->Session->User->Preference('ShowLargeCommentBox') ? 'LargeCommentBox' : 'SmallCommentBox')
				.'" id="CommentBox" rows="10" cols="85"'.$this->DiscussionFormAttributes.'>'
				.$Discussion->Comment->Body
				.'</textarea>
			</li>'
			.$this->GetPostFormatting($Discussion->Comment->FormatType).'
		</ul>
  		<div class="Submit">
			<input type="submit" name="btnSave" value="'.$this->Context->GetDefinition('SendPrivateMessage').'" class="Button SubmitButton StartDiscussionButton" onclick="'
			."Wait(this, '".$this->Context->GetDefinition('Wait')."');"
			.'"/>
			<a href="'.(!$this->IsPostBack?'javascript:history.back();':'./').'" class="CancelButton">'.$this->Context->GetDefinition('Cancel').'</a>
		</div>
	</form>
	</fieldset>
</div>';
?>